package com.swn.food;

public class WuMingFen {
    private String theMa;          //面码
    private int quantity;          //粉的分量(两)
    private boolean likeSoup;      //是否带汤 boolean默认为false

    //此为构造方法 以便于简化初始化过程
    public WuMingFen(String theMa, int quantity, boolean likeSoup) {
        this.theMa = theMa;
        this.quantity = quantity;
        this.likeSoup = likeSoup;
    }
    //重载构造方法 使得初始化过程可以多样化
    public WuMingFen(String theMa, int quantity) {
        this.theMa = theMa;
        this.quantity = quantity;
    }
    //无参构造。如何使得下列语句构造出来的粉对象是酸辣面码、2两、带汤的？
    public WuMingFen() {
        this.theMa="酸辣";
        this.quantity=2;
        this.likeSoup=true;
    }
    //写一个普通方法 check() 用于查看粉是否符合要求。即 将对象的三个属性打印在控制台上。
    public void check(){
        System.out.println("面码:"+theMa+" \n粉的分量:"+quantity+" \n是否带汤:"+(likeSoup?"是":"否"));
    }
}
